package com.example.servicea.rpc;

import com.example.common.msg.R;
import com.example.servicea.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登陆相关接口
 *
 * @author hutu
 * @date 2018/6/8 11:48
 */
@RestController
@RequestMapping("upms")
public class LoginController {

    @Autowired
    LoginService loginService;

    @GetMapping("login")
    public R login() {
        R admin = loginService.login("admin", "123");
        return admin;
    }
    @GetMapping("")
    public R getUserPermiss(@RequestParam(value = "id",name = "用户ID") String userId){
        loginService.getUserPermiss(userId);
        return R.ok();
    }
}
